<template>
  <div>
    <h1>Movie组件</h1>
    <p>count组件中的num数据是:{{ num }}</p>
    <button @click="getMovieList">获取电影列表</button>
    <ul>
      <li v-for="item in movieList" :key="item.albumId">
        {{ item.albumName }}
      </li>
    </ul>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "Movie",
});
</script>

<script setup lang="ts">
import useCountState from "@/store/count";
import useMovieState from "@/store/movie";
import { storeToRefs } from "pinia";

const countState = useCountState();
const movieState = useMovieState();

const { num } = storeToRefs(countState);
const { movieList } = storeToRefs(movieState);

const { getMovieList } = movieState;
</script>

<style scoped lang="scss"></style>
